const pkg = require('./package')

module.exports = {

  buildDir: 'nuxt-dist',
  // debug:false,
  // dev:false,
  // //缓存配置
  // cache: true,
  // cache: {
  //   max: 1000,//缓存组件的最大数目，当第 1001 个组件被添加至缓存中时， 第一个被缓存的组件会从缓存中移除。
  //   maxAge: 900000//缓存时间，单位毫秒, 默认是 15 分钟。
  // },

  /*
  ** Headers of the page
  */
  head: {
    title: pkg.name,
    meta: [
      { charset: 'utf-8' },
      { 'http-equiv': 'pragma', content: 'no-cache' },
      { 'http-equiv': 'cache-control', content: 'no-cache' },
      { 'http-equiv': 'expires', content: '0' },
      { content: 'telephone=no', name: 'format-detection' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no' },
      { name: 'renderer', content: `webkit|ie-comp|ie-stand`},
      { hid: 'description', name: 'description', content: pkg.description },
    ],
    script: [
      { src: 'https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      { rel: 'stylesheet', href: 'https://cdn.bootcss.com/iview/3.1.5/styles/iview.css' },
    ]
  },

  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#218ff2' },
  //loading: '~/components/loading.vue',//自定义Loading页面

  /*
  ** Global CSS
  */
  css: [
  ],

  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    { src: "~/plugins/axios.js", ssr: true },
    { src: "~/plugins/iview.js", ssr: true },
    { src: "~/plugins/i18n.js", ssr: true }

  ],
  generate: {

  },
  router: {
    middleware: 'i18n',
  },

  /*
  ** Nuxt.js modules
  */
  modules: [
    // Doc: https://github.com/nuxt-community/axios-module#usage
    '@nuxtjs/axios',
    '@nuxtjs/proxy'
  ],

  proxy: [

  ],

  // router: {
  //   middleware: ['userAuth'],
  // },

  /*
  ** Axios module configuration
  */
  axios: {
    // See https://github.com/nuxt-community/axios-module#options
  },

  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    extractCSS: { allChunks: true },
    extend(config, {isDev, isClient }) {

    },
    vendor: ['axios'],
    //publicPath: 'https://cdn.domian.com', //默认: '/_nuxt/' 客户端CDN发布使用
  }
}
